/*
================================================================================
SimpleHat                                                           by AngleWyrm

  This program exercises the functions of the SimpleHat template class

================================================================================
*/
#include <iostream>
using std::cout;
using std::endl;
#include <string>
using std::string;
#include "simple_hat.hpp"
using  namespace hat;

int main()
{
    srand(time(NULL));

    // some data and a hat to put them in
    simple_hat<string> my_hat;
    string names[10] = {"Alice", "Bob", "Carol", "Dick", "Ellen", "Frank",
        "Ginger", "Hank", "Inga", "John"};

    // load names into hat
    cout << "loading values" << endl;
    for(int i=0; i<10; i++){
        my_hat.put( names[i] );

        // print current contents
        for(size_t j=0; j<my_hat.size(); j++){
            my_hat.print(j);
        }
        cout << endl;
    }

    // get names from hat without removing them
    cout << "\n\ngetting names\n";
    for(int i=0; i<20; i++){
        cout << my_hat.get() << " ";
    }

    // pull names out of hat
    cout << "\n\npulling names\n";
    string buffer;
    while( my_hat.size() != 0 ){
        cout << endl << "Pulled: " << my_hat.pull(buffer) << endl;

        // print current contents
        for(size_t i=0; i<my_hat.size(); i++){
            my_hat.print(i);
        }
        cout << endl;
    }

    // array of hats
    simple_hat<int> hats[10];

    return 0;
}
